
using System;
using System.Reflection;
using System.Collections;
using UniversalStorageServices;
using UniversalStorageServices.PersistenceManager;

		

namespace Demo
{
		
	public interface ICompany
	{
		string Id { get; set; }
		System.String Name { get; set; }
		System.Int32 SiretNb { get; set; }
		
	}
	
	
		/// <summary>
	/// <para>
	/// A collection that stores <see cref='Company'/> objects.
	/// </para>
	/// </summary>
	/// <seealso cref='CompanyCollection'/>
	[Serializable()]
	public class  CompanyCollection : IPersistableCollection 
	{	
		/// <summary>
		/// <para>
		/// Initializes a new instance of <see cref='CompanyCollection'/>.
		/// </para>
		/// </summary>
		public CompanyCollection()
		{
		}
		
		/// <summary>
		/// <para>
		/// Initializes a new instance of <see cref='CompanyCollection'/> based on another <see cref='CompanyCollection'/>.
		/// </para>
		/// </summary>
		/// <param name='val'>
		/// A <see cref='CompanyCollection'/> from which the contents are copied
		/// </param>
		public CompanyCollection( CompanyCollection val)
		{
			this.AddRange(val);	
		}
		
		/// <summary>
		/// <para>
		/// Initializes a new instance of <see cref='CompanyCollection'/> containing any array of <see cref='Company'/> objects.
		/// </para>
		/// </summary>
		/// <param name='val'>
		/// A array of <see cref='Company'/> objects with which to intialize the collection
		/// </param>
		public CompanyCollection( Company[] val)
		{
			this.AddRange(val);
		}
		
		public CompanyCollection (Entity parentEntity, string role, IPersistableCollection data): base(parentEntity, role, data)
		{
		}
		
		/// <summary>
		/// <para>Represents the entry at the specified index of the <see cref='Company'/>.</para>
		/// </summary>
		/// <param name='index'><para>The zero-based index of the entry to locate in the collection.</para></param>
		/// <value>
		/// <para> The entry at the specified index of the collection.</para>
		/// </value>
		/// <exception cref='System.ArgumentOutOfRangeException'><paramref name='index'/> is outside the valid range of indexes for the collection.</exception>
		public new Company this[int index] 
		{
			get 
			{
				return ((Company)base[index]);
			}
			set 
			{
				base[index] = value;
			}
		}
		
		/// <summary>
		/// <para>Adds a <see cref='Company'/> with the specified value to the 
		/// <see cref='CompanyCollection'/> .</para>
		/// </summary>
		/// <param name='val'>The <see cref='Company'/> to add.</param>
		/// <returns>
		/// <para>The index at which the new element was inserted.</para>
		/// </returns>
		/// <seealso cref='CompanyCollection.AddRange'/>
		public int Add( Company val)
		{
			return base.Add(val);
		}
		
	
		
		/// <summary>
		/// <para>
		/// Adds the contents of another <see cref='CompanyCollection'/> to the end of the collection.
		/// </para>
		/// </summary>
		/// <param name='val'>
		/// A <see cref='CompanyCollection'/> containing the objects to add to the collection.
		/// </param>
		/// <returns>
		/// <para>None.</para>
		/// </returns>
		/// <seealso cref='CompanyCollection.Add'/>
		public void AddRange( CompanyCollection val)
		{
			base.AddRange(val);
		}
		public void AddRange( Company[] val)
		{
			base.AddRange(val);
		}
		
		/// <summary>
		/// <para>Gets a value indicating whether the 
		/// <see cref='CompanyCollection'/> contains the specified <see cref='Company'/>.</para>
		/// </summary>
		/// <param name='val'>The <see cref='Company'/> to locate.</param>
		/// <returns>
		/// <para><see langword='true'/> if the <see cref='Company'/> is contained in the collection; 
		/// otherwise, <see langword='false'/>.</para>
		/// </returns>
		/// <seealso cref='CompanyCollection.IndexOf'/>
		public bool Contains( Company val)
		{
			return List.Contains(val);
		}
		
		/// <summary>
		/// <para>Copies the <see cref='CompanyCollection'/> values to a one-dimensional <see cref='System.Array'/> instance at the 
		/// specified index.</para>
		/// </summary>
		/// <param name='array'><para>The one-dimensional <see cref='System.Array'/> that is the destination of the values copied from <see cref='CompanyCollection'/> .</para></param>
		/// <param name='index'>The index in <paramref name='array'/> where copying begins.</param>
		/// <returns>
		/// <para>None.</para>
		/// </returns>
		/// <exception cref='System.ArgumentException'><para><paramref name='array'/> is multidimensional.</para> <para>-or-</para> <para>The number of elements in the <see cref='CompanyCollection'/> is greater than the available space between <paramref name='index'/> and the end of <paramref name='array'/>.</para></exception>
		/// <exception cref='System.ArgumentNullException'><paramref name='array'/> is <see langword='null'/>. </exception>
		/// <exception cref='System.ArgumentOutOfRangeException'><paramref name='index'/> is less than <paramref name='array'/>'s lowbound. </exception>
		/// <seealso cref='System.Array'/>
		public void CopyTo( Company[] array, int index)
		{
			List.CopyTo(array, index);
		}
		
		/// <summary>
		/// <para>Returns the index of a <see cref='Company'/> in 
		/// the <see cref='CompanyCollection'/> .</para>
		/// </summary>
		/// <param name='val'>The <see cref='Company'/> to locate.</param>
		/// <returns>
		/// <para>The index of the <see cref='Company'/> of <paramref name='val'/> in the 
		/// <see cref='CompanyCollection'/>, if found; otherwise, -1.</para>
		/// </returns>
		/// <seealso cref='CompanyCollection.Contains'/>
		public int IndexOf( Company val)
		{
			return List.IndexOf(val);
		}
		
		/// <summary>
		/// <para>Inserts a <see cref='Company'/> into the <see cref='CompanyCollection'/> at the specified index.</para>
		/// </summary>
		/// <param name='index'>The zero-based index where <paramref name='val'/> should be inserted.</param>
		/// <param name='val'>The <see cref='Company'/> to insert.</param>
		/// <returns><para>None.</para></returns>
		/// <seealso cref='CompanyCollection.Add'/>
		public void Insert(int index,  Company val)
		{
			List.Insert(index, val);
		}
		
		/// <summary>
		/// <para>Returns an enumerator that can iterate through 
		/// the <see cref='CompanyCollection'/> .</para>
		/// </summary>
		/// <returns><para>None.</para></returns>
		/// <seealso cref='System.Collections.IEnumerator'/>
		public new  CompanyEnumerator GetEnumerator()
		{
			return new  CompanyEnumerator(this);
		}
		
		/// <summary>
		/// <para> Removes a specific <see cref='Company'/> from the 
		/// <see cref='CompanyCollection'/> .</para>
		/// </summary>
		/// <param name='val'>The <see cref='Company'/> to remove from the <see cref='CompanyCollection'/> .</param>
		/// <returns><para>None.</para></returns>
		/// <exception cref='System.ArgumentException'><paramref name='val'/> is not found in the Collection. </exception>
		public void Remove( Company val)
		{
			List.Remove(val);
		}
		
		public class  CompanyEnumerator : IEnumerator
		{
			IEnumerator baseEnumerator;
			IEnumerable temp;
			
			public  CompanyEnumerator( CompanyCollection mappings)
			{
				this.temp = mappings;
				this.baseEnumerator = temp.GetEnumerator();
			}
			
			public  Company Current 
			{
				get 
				{
					return (( Company)(baseEnumerator.Current));
				}
			}
			
			object IEnumerator.Current 
			{
				get 
				{
					return baseEnumerator.Current;
				}
			}
			
			public bool MoveNext()
			{
				return baseEnumerator.MoveNext();
			}
			
			bool IEnumerator.MoveNext()
			{
				return baseEnumerator.MoveNext();
			}
			
			public void Reset()
			{
				baseEnumerator.Reset();
			}
			
			void IEnumerator.Reset()
			{
				baseEnumerator.Reset();
			}
		}
	}

	
	[Serializable]
	public class Company :  IPersistable, ICompany 
	{		
	
		protected Entity _Entity;
		
		[NonSerialized]
		protected PersistenceManager _PersistenceManager;
		
		Entity IPersistable.Entity
		{
			get
			{
				return _Entity;
			}
			set
			{
				_Entity = value;
			}
		}
		
		PersistenceManager IPersistable.PersistenceManager
		{
			get
			{
				return _PersistenceManager;
			}
			set
			{
				_PersistenceManager = value;
			}
		}
		
		public string Id
		{
			get
			{
				return _Entity.Id;
			}
			set
			{
				_Entity.Id = value;
			}
		}
		
		~Company()
		{
			if(_PersistenceManager != null)
				_PersistenceManager.RemoveFromCache(this);
		}
	
		void IPersistable.TrackChildren()
		{
			// if the object is not tracked there is nothing to do
			if(_PersistenceManager == null)
				return;
	
		}
		
		void IPersistable.DeleteChildren()
		{	
	
		}
	
		public System.String Name
		{
			get 
			{ 
				if(_Entity.GetValue("Name") == null)
					return (new System.String[1])[0];
				else
					return (System.String)this._Entity["Name"]; 
			}
		
			set 
			{ 
				this._Entity["Name"] = value; 
			}
		}
		
		public System.Int32 SiretNb
		{
			get 
			{ 
				if(_Entity.GetValue("SiretNb") == null)
					return (new System.Int32[1])[0];
				else
					return (System.Int32)this._Entity["SiretNb"]; 
			}
		
			set 
			{ 
				this._Entity["SiretNb"] = value; 
			}
		}
		
		public Company ()
		{
			
			this._Entity = new Entity(PersistenceManager.ConvertNamespaceDomainToEuss(this.GetType().FullName));
		}

		public Company (Entity e): this()
		{
			this._Entity = e;
		}

		private ParentRelationships _Parents;

		public ParentRelationships Parents
		{
			get
			{
				if (_Parents == null)
					if (_PersistenceManager == null)
						throw new ApplicationException("Can't call Parents untracked objects");
				else
					_Parents = new ParentRelationships(this);

				return _Parents;
			}
		}

		public class ParentRelationships
		{
			private IPersistable _Owner;
	
			public ParentRelationships(IPersistable o)
			{
				_Owner = o;
			}
		
		}
	}
	
	public interface ICarFactory
	{
		string Id { get; set; }
		System.String CarSort { get; set; }
		
	}
	
	
		/// <summary>
	/// <para>
	/// A collection that stores <see cref='CarFactory'/> objects.
	/// </para>
	/// </summary>
	/// <seealso cref='CarFactoryCollection'/>
	[Serializable()]
	public class  CarFactoryCollection : IPersistableCollection 
	{	
		/// <summary>
		/// <para>
		/// Initializes a new instance of <see cref='CarFactoryCollection'/>.
		/// </para>
		/// </summary>
		public CarFactoryCollection()
		{
		}
		
		/// <summary>
		/// <para>
		/// Initializes a new instance of <see cref='CarFactoryCollection'/> based on another <see cref='CarFactoryCollection'/>.
		/// </para>
		/// </summary>
		/// <param name='val'>
		/// A <see cref='CarFactoryCollection'/> from which the contents are copied
		/// </param>
		public CarFactoryCollection( CarFactoryCollection val)
		{
			this.AddRange(val);	
		}
		
		/// <summary>
		/// <para>
		/// Initializes a new instance of <see cref='CarFactoryCollection'/> containing any array of <see cref='CarFactory'/> objects.
		/// </para>
		/// </summary>
		/// <param name='val'>
		/// A array of <see cref='CarFactory'/> objects with which to intialize the collection
		/// </param>
		public CarFactoryCollection( CarFactory[] val)
		{
			this.AddRange(val);
		}
		
		public CarFactoryCollection (Entity parentEntity, string role, IPersistableCollection data): base(parentEntity, role, data)
		{
		}
		
		/// <summary>
		/// <para>Represents the entry at the specified index of the <see cref='CarFactory'/>.</para>
		/// </summary>
		/// <param name='index'><para>The zero-based index of the entry to locate in the collection.</para></param>
		/// <value>
		/// <para> The entry at the specified index of the collection.</para>
		/// </value>
		/// <exception cref='System.ArgumentOutOfRangeException'><paramref name='index'/> is outside the valid range of indexes for the collection.</exception>
		public new CarFactory this[int index] 
		{
			get 
			{
				return ((CarFactory)base[index]);
			}
			set 
			{
				base[index] = value;
			}
		}
		
		/// <summary>
		/// <para>Adds a <see cref='CarFactory'/> with the specified value to the 
		/// <see cref='CarFactoryCollection'/> .</para>
		/// </summary>
		/// <param name='val'>The <see cref='CarFactory'/> to add.</param>
		/// <returns>
		/// <para>The index at which the new element was inserted.</para>
		/// </returns>
		/// <seealso cref='CarFactoryCollection.AddRange'/>
		public int Add( CarFactory val)
		{
			return base.Add(val);
		}
		
	
		
		/// <summary>
		/// <para>
		/// Adds the contents of another <see cref='CarFactoryCollection'/> to the end of the collection.
		/// </para>
		/// </summary>
		/// <param name='val'>
		/// A <see cref='CarFactoryCollection'/> containing the objects to add to the collection.
		/// </param>
		/// <returns>
		/// <para>None.</para>
		/// </returns>
		/// <seealso cref='CarFactoryCollection.Add'/>
		public void AddRange( CarFactoryCollection val)
		{
			base.AddRange(val);
		}
		public void AddRange( CarFactory[] val)
		{
			base.AddRange(val);
		}
		
		/// <summary>
		/// <para>Gets a value indicating whether the 
		/// <see cref='CarFactoryCollection'/> contains the specified <see cref='CarFactory'/>.</para>
		/// </summary>
		/// <param name='val'>The <see cref='CarFactory'/> to locate.</param>
		/// <returns>
		/// <para><see langword='true'/> if the <see cref='CarFactory'/> is contained in the collection; 
		/// otherwise, <see langword='false'/>.</para>
		/// </returns>
		/// <seealso cref='CarFactoryCollection.IndexOf'/>
		public bool Contains( CarFactory val)
		{
			return List.Contains(val);
		}
		
		/// <summary>
		/// <para>Copies the <see cref='CarFactoryCollection'/> values to a one-dimensional <see cref='System.Array'/> instance at the 
		/// specified index.</para>
		/// </summary>
		/// <param name='array'><para>The one-dimensional <see cref='System.Array'/> that is the destination of the values copied from <see cref='CarFactoryCollection'/> .</para></param>
		/// <param name='index'>The index in <paramref name='array'/> where copying begins.</param>
		/// <returns>
		/// <para>None.</para>
		/// </returns>
		/// <exception cref='System.ArgumentException'><para><paramref name='array'/> is multidimensional.</para> <para>-or-</para> <para>The number of elements in the <see cref='CarFactoryCollection'/> is greater than the available space between <paramref name='index'/> and the end of <paramref name='array'/>.</para></exception>
		/// <exception cref='System.ArgumentNullException'><paramref name='array'/> is <see langword='null'/>. </exception>
		/// <exception cref='System.ArgumentOutOfRangeException'><paramref name='index'/> is less than <paramref name='array'/>'s lowbound. </exception>
		/// <seealso cref='System.Array'/>
		public void CopyTo( CarFactory[] array, int index)
		{
			List.CopyTo(array, index);
		}
		
		/// <summary>
		/// <para>Returns the index of a <see cref='CarFactory'/> in 
		/// the <see cref='CarFactoryCollection'/> .</para>
		/// </summary>
		/// <param name='val'>The <see cref='CarFactory'/> to locate.</param>
		/// <returns>
		/// <para>The index of the <see cref='CarFactory'/> of <paramref name='val'/> in the 
		/// <see cref='CarFactoryCollection'/>, if found; otherwise, -1.</para>
		/// </returns>
		/// <seealso cref='CarFactoryCollection.Contains'/>
		public int IndexOf( CarFactory val)
		{
			return List.IndexOf(val);
		}
		
		/// <summary>
		/// <para>Inserts a <see cref='CarFactory'/> into the <see cref='CarFactoryCollection'/> at the specified index.</para>
		/// </summary>
		/// <param name='index'>The zero-based index where <paramref name='val'/> should be inserted.</param>
		/// <param name='val'>The <see cref='CarFactory'/> to insert.</param>
		/// <returns><para>None.</para></returns>
		/// <seealso cref='CarFactoryCollection.Add'/>
		public void Insert(int index,  CarFactory val)
		{
			List.Insert(index, val);
		}
		
		/// <summary>
		/// <para>Returns an enumerator that can iterate through 
		/// the <see cref='CarFactoryCollection'/> .</para>
		/// </summary>
		/// <returns><para>None.</para></returns>
		/// <seealso cref='System.Collections.IEnumerator'/>
		public new  CarFactoryEnumerator GetEnumerator()
		{
			return new  CarFactoryEnumerator(this);
		}
		
		/// <summary>
		/// <para> Removes a specific <see cref='CarFactory'/> from the 
		/// <see cref='CarFactoryCollection'/> .</para>
		/// </summary>
		/// <param name='val'>The <see cref='CarFactory'/> to remove from the <see cref='CarFactoryCollection'/> .</param>
		/// <returns><para>None.</para></returns>
		/// <exception cref='System.ArgumentException'><paramref name='val'/> is not found in the Collection. </exception>
		public void Remove( CarFactory val)
		{
			List.Remove(val);
		}
		
		public class  CarFactoryEnumerator : IEnumerator
		{
			IEnumerator baseEnumerator;
			IEnumerable temp;
			
			public  CarFactoryEnumerator( CarFactoryCollection mappings)
			{
				this.temp = mappings;
				this.baseEnumerator = temp.GetEnumerator();
			}
			
			public  CarFactory Current 
			{
				get 
				{
					return (( CarFactory)(baseEnumerator.Current));
				}
			}
			
			object IEnumerator.Current 
			{
				get 
				{
					return baseEnumerator.Current;
				}
			}
			
			public bool MoveNext()
			{
				return baseEnumerator.MoveNext();
			}
			
			bool IEnumerator.MoveNext()
			{
				return baseEnumerator.MoveNext();
			}
			
			public void Reset()
			{
				baseEnumerator.Reset();
			}
			
			void IEnumerator.Reset()
			{
				baseEnumerator.Reset();
			}
		}
	}

	
	[Serializable]
	public class CarFactory : Company, IPersistable, ICarFactory 
	{		
	
		void IPersistable.TrackChildren()
		{
			// if the object is not tracked there is nothing to do
			if(_PersistenceManager == null)
				return;
	
		}
		
		void IPersistable.DeleteChildren()
		{	
	
		}
	
		public System.String CarSort
		{
			get 
			{ 
				if(_Entity.GetValue("CarSort") == null)
					return (new System.String[1])[0];
				else
					return (System.String)this._Entity["CarSort"]; 
			}
		
			set 
			{ 
				this._Entity["CarSort"] = value; 
			}
		}
		
		public CarFactory ()
		{
			
			this._Entity = new Entity(PersistenceManager.ConvertNamespaceDomainToEuss(this.GetType().FullName));
		}

		public CarFactory (Entity e): this()
		{
			this._Entity = e;
		}

		private ParentRelationships _Parents;

		public new ParentRelationships Parents
		{
			get
			{
				if (_Parents == null)
					if (_PersistenceManager == null)
						throw new ApplicationException("Can't call Parents untracked objects");
				else
					_Parents = new ParentRelationships(this);

				return _Parents;
			}
		}

		public new class ParentRelationships
		{
			private IPersistable _Owner;
	
			public ParentRelationships(IPersistable o)
			{
				_Owner = o;
			}
		
		}
	}
	
	public interface IBakery
	{
		string Id { get; set; }
		System.String BakerySort { get; set; }
		
	}
	
	
		/// <summary>
	/// <para>
	/// A collection that stores <see cref='Bakery'/> objects.
	/// </para>
	/// </summary>
	/// <seealso cref='BakeryCollection'/>
	[Serializable()]
	public class  BakeryCollection : IPersistableCollection 
	{	
		/// <summary>
		/// <para>
		/// Initializes a new instance of <see cref='BakeryCollection'/>.
		/// </para>
		/// </summary>
		public BakeryCollection()
		{
		}
		
		/// <summary>
		/// <para>
		/// Initializes a new instance of <see cref='BakeryCollection'/> based on another <see cref='BakeryCollection'/>.
		/// </para>
		/// </summary>
		/// <param name='val'>
		/// A <see cref='BakeryCollection'/> from which the contents are copied
		/// </param>
		public BakeryCollection( BakeryCollection val)
		{
			this.AddRange(val);	
		}
		
		/// <summary>
		/// <para>
		/// Initializes a new instance of <see cref='BakeryCollection'/> containing any array of <see cref='Bakery'/> objects.
		/// </para>
		/// </summary>
		/// <param name='val'>
		/// A array of <see cref='Bakery'/> objects with which to intialize the collection
		/// </param>
		public BakeryCollection( Bakery[] val)
		{
			this.AddRange(val);
		}
		
		public BakeryCollection (Entity parentEntity, string role, IPersistableCollection data): base(parentEntity, role, data)
		{
		}
		
		/// <summary>
		/// <para>Represents the entry at the specified index of the <see cref='Bakery'/>.</para>
		/// </summary>
		/// <param name='index'><para>The zero-based index of the entry to locate in the collection.</para></param>
		/// <value>
		/// <para> The entry at the specified index of the collection.</para>
		/// </value>
		/// <exception cref='System.ArgumentOutOfRangeException'><paramref name='index'/> is outside the valid range of indexes for the collection.</exception>
		public new Bakery this[int index] 
		{
			get 
			{
				return ((Bakery)base[index]);
			}
			set 
			{
				base[index] = value;
			}
		}
		
		/// <summary>
		/// <para>Adds a <see cref='Bakery'/> with the specified value to the 
		/// <see cref='BakeryCollection'/> .</para>
		/// </summary>
		/// <param name='val'>The <see cref='Bakery'/> to add.</param>
		/// <returns>
		/// <para>The index at which the new element was inserted.</para>
		/// </returns>
		/// <seealso cref='BakeryCollection.AddRange'/>
		public int Add( Bakery val)
		{
			return base.Add(val);
		}
		
	
		
		/// <summary>
		/// <para>
		/// Adds the contents of another <see cref='BakeryCollection'/> to the end of the collection.
		/// </para>
		/// </summary>
		/// <param name='val'>
		/// A <see cref='BakeryCollection'/> containing the objects to add to the collection.
		/// </param>
		/// <returns>
		/// <para>None.</para>
		/// </returns>
		/// <seealso cref='BakeryCollection.Add'/>
		public void AddRange( BakeryCollection val)
		{
			base.AddRange(val);
		}
		public void AddRange( Bakery[] val)
		{
			base.AddRange(val);
		}
		
		/// <summary>
		/// <para>Gets a value indicating whether the 
		/// <see cref='BakeryCollection'/> contains the specified <see cref='Bakery'/>.</para>
		/// </summary>
		/// <param name='val'>The <see cref='Bakery'/> to locate.</param>
		/// <returns>
		/// <para><see langword='true'/> if the <see cref='Bakery'/> is contained in the collection; 
		/// otherwise, <see langword='false'/>.</para>
		/// </returns>
		/// <seealso cref='BakeryCollection.IndexOf'/>
		public bool Contains( Bakery val)
		{
			return List.Contains(val);
		}
		
		/// <summary>
		/// <para>Copies the <see cref='BakeryCollection'/> values to a one-dimensional <see cref='System.Array'/> instance at the 
		/// specified index.</para>
		/// </summary>
		/// <param name='array'><para>The one-dimensional <see cref='System.Array'/> that is the destination of the values copied from <see cref='BakeryCollection'/> .</para></param>
		/// <param name='index'>The index in <paramref name='array'/> where copying begins.</param>
		/// <returns>
		/// <para>None.</para>
		/// </returns>
		/// <exception cref='System.ArgumentException'><para><paramref name='array'/> is multidimensional.</para> <para>-or-</para> <para>The number of elements in the <see cref='BakeryCollection'/> is greater than the available space between <paramref name='index'/> and the end of <paramref name='array'/>.</para></exception>
		/// <exception cref='System.ArgumentNullException'><paramref name='array'/> is <see langword='null'/>. </exception>
		/// <exception cref='System.ArgumentOutOfRangeException'><paramref name='index'/> is less than <paramref name='array'/>'s lowbound. </exception>
		/// <seealso cref='System.Array'/>
		public void CopyTo( Bakery[] array, int index)
		{
			List.CopyTo(array, index);
		}
		
		/// <summary>
		/// <para>Returns the index of a <see cref='Bakery'/> in 
		/// the <see cref='BakeryCollection'/> .</para>
		/// </summary>
		/// <param name='val'>The <see cref='Bakery'/> to locate.</param>
		/// <returns>
		/// <para>The index of the <see cref='Bakery'/> of <paramref name='val'/> in the 
		/// <see cref='BakeryCollection'/>, if found; otherwise, -1.</para>
		/// </returns>
		/// <seealso cref='BakeryCollection.Contains'/>
		public int IndexOf( Bakery val)
		{
			return List.IndexOf(val);
		}
		
		/// <summary>
		/// <para>Inserts a <see cref='Bakery'/> into the <see cref='BakeryCollection'/> at the specified index.</para>
		/// </summary>
		/// <param name='index'>The zero-based index where <paramref name='val'/> should be inserted.</param>
		/// <param name='val'>The <see cref='Bakery'/> to insert.</param>
		/// <returns><para>None.</para></returns>
		/// <seealso cref='BakeryCollection.Add'/>
		public void Insert(int index,  Bakery val)
		{
			List.Insert(index, val);
		}
		
		/// <summary>
		/// <para>Returns an enumerator that can iterate through 
		/// the <see cref='BakeryCollection'/> .</para>
		/// </summary>
		/// <returns><para>None.</para></returns>
		/// <seealso cref='System.Collections.IEnumerator'/>
		public new  BakeryEnumerator GetEnumerator()
		{
			return new  BakeryEnumerator(this);
		}
		
		/// <summary>
		/// <para> Removes a specific <see cref='Bakery'/> from the 
		/// <see cref='BakeryCollection'/> .</para>
		/// </summary>
		/// <param name='val'>The <see cref='Bakery'/> to remove from the <see cref='BakeryCollection'/> .</param>
		/// <returns><para>None.</para></returns>
		/// <exception cref='System.ArgumentException'><paramref name='val'/> is not found in the Collection. </exception>
		public void Remove( Bakery val)
		{
			List.Remove(val);
		}
		
		public class  BakeryEnumerator : IEnumerator
		{
			IEnumerator baseEnumerator;
			IEnumerable temp;
			
			public  BakeryEnumerator( BakeryCollection mappings)
			{
				this.temp = mappings;
				this.baseEnumerator = temp.GetEnumerator();
			}
			
			public  Bakery Current 
			{
				get 
				{
					return (( Bakery)(baseEnumerator.Current));
				}
			}
			
			object IEnumerator.Current 
			{
				get 
				{
					return baseEnumerator.Current;
				}
			}
			
			public bool MoveNext()
			{
				return baseEnumerator.MoveNext();
			}
			
			bool IEnumerator.MoveNext()
			{
				return baseEnumerator.MoveNext();
			}
			
			public void Reset()
			{
				baseEnumerator.Reset();
			}
			
			void IEnumerator.Reset()
			{
				baseEnumerator.Reset();
			}
		}
	}

	
	[Serializable]
	public class Bakery : Company, IPersistable, IBakery 
	{		
	
		void IPersistable.TrackChildren()
		{
			// if the object is not tracked there is nothing to do
			if(_PersistenceManager == null)
				return;
	
		}
		
		void IPersistable.DeleteChildren()
		{	
	
		}
	
		public System.String BakerySort
		{
			get 
			{ 
				if(_Entity.GetValue("BakerySort") == null)
					return (new System.String[1])[0];
				else
					return (System.String)this._Entity["BakerySort"]; 
			}
		
			set 
			{ 
				this._Entity["BakerySort"] = value; 
			}
		}
		
		public Bakery ()
		{
			
			this._Entity = new Entity(PersistenceManager.ConvertNamespaceDomainToEuss(this.GetType().FullName));
		}

		public Bakery (Entity e): this()
		{
			this._Entity = e;
		}

		private ParentRelationships _Parents;

		public new ParentRelationships Parents
		{
			get
			{
				if (_Parents == null)
					if (_PersistenceManager == null)
						throw new ApplicationException("Can't call Parents untracked objects");
				else
					_Parents = new ParentRelationships(this);

				return _Parents;
			}
		}

		public new class ParentRelationships
		{
			private IPersistable _Owner;
	
			public ParentRelationships(IPersistable o)
			{
				_Owner = o;
			}
		
		}
	}
	
	public interface ISoftwareEditor
	{
		string Id { get; set; }
		System.String SoftwareSort { get; set; }
		
	}
	
	
		/// <summary>
	/// <para>
	/// A collection that stores <see cref='SoftwareEditor'/> objects.
	/// </para>
	/// </summary>
	/// <seealso cref='SoftwareEditorCollection'/>
	[Serializable()]
	public class  SoftwareEditorCollection : IPersistableCollection 
	{	
		/// <summary>
		/// <para>
		/// Initializes a new instance of <see cref='SoftwareEditorCollection'/>.
		/// </para>
		/// </summary>
		public SoftwareEditorCollection()
		{
		}
		
		/// <summary>
		/// <para>
		/// Initializes a new instance of <see cref='SoftwareEditorCollection'/> based on another <see cref='SoftwareEditorCollection'/>.
		/// </para>
		/// </summary>
		/// <param name='val'>
		/// A <see cref='SoftwareEditorCollection'/> from which the contents are copied
		/// </param>
		public SoftwareEditorCollection( SoftwareEditorCollection val)
		{
			this.AddRange(val);	
		}
		
		/// <summary>
		/// <para>
		/// Initializes a new instance of <see cref='SoftwareEditorCollection'/> containing any array of <see cref='SoftwareEditor'/> objects.
		/// </para>
		/// </summary>
		/// <param name='val'>
		/// A array of <see cref='SoftwareEditor'/> objects with which to intialize the collection
		/// </param>
		public SoftwareEditorCollection( SoftwareEditor[] val)
		{
			this.AddRange(val);
		}
		
		public SoftwareEditorCollection (Entity parentEntity, string role, IPersistableCollection data): base(parentEntity, role, data)
		{
		}
		
		/// <summary>
		/// <para>Represents the entry at the specified index of the <see cref='SoftwareEditor'/>.</para>
		/// </summary>
		/// <param name='index'><para>The zero-based index of the entry to locate in the collection.</para></param>
		/// <value>
		/// <para> The entry at the specified index of the collection.</para>
		/// </value>
		/// <exception cref='System.ArgumentOutOfRangeException'><paramref name='index'/> is outside the valid range of indexes for the collection.</exception>
		public new SoftwareEditor this[int index] 
		{
			get 
			{
				return ((SoftwareEditor)base[index]);
			}
			set 
			{
				base[index] = value;
			}
		}
		
		/// <summary>
		/// <para>Adds a <see cref='SoftwareEditor'/> with the specified value to the 
		/// <see cref='SoftwareEditorCollection'/> .</para>
		/// </summary>
		/// <param name='val'>The <see cref='SoftwareEditor'/> to add.</param>
		/// <returns>
		/// <para>The index at which the new element was inserted.</para>
		/// </returns>
		/// <seealso cref='SoftwareEditorCollection.AddRange'/>
		public int Add( SoftwareEditor val)
		{
			return base.Add(val);
		}
		
	
		
		/// <summary>
		/// <para>
		/// Adds the contents of another <see cref='SoftwareEditorCollection'/> to the end of the collection.
		/// </para>
		/// </summary>
		/// <param name='val'>
		/// A <see cref='SoftwareEditorCollection'/> containing the objects to add to the collection.
		/// </param>
		/// <returns>
		/// <para>None.</para>
		/// </returns>
		/// <seealso cref='SoftwareEditorCollection.Add'/>
		public void AddRange( SoftwareEditorCollection val)
		{
			base.AddRange(val);
		}
		public void AddRange( SoftwareEditor[] val)
		{
			base.AddRange(val);
		}
		
		/// <summary>
		/// <para>Gets a value indicating whether the 
		/// <see cref='SoftwareEditorCollection'/> contains the specified <see cref='SoftwareEditor'/>.</para>
		/// </summary>
		/// <param name='val'>The <see cref='SoftwareEditor'/> to locate.</param>
		/// <returns>
		/// <para><see langword='true'/> if the <see cref='SoftwareEditor'/> is contained in the collection; 
		/// otherwise, <see langword='false'/>.</para>
		/// </returns>
		/// <seealso cref='SoftwareEditorCollection.IndexOf'/>
		public bool Contains( SoftwareEditor val)
		{
			return List.Contains(val);
		}
		
		/// <summary>
		/// <para>Copies the <see cref='SoftwareEditorCollection'/> values to a one-dimensional <see cref='System.Array'/> instance at the 
		/// specified index.</para>
		/// </summary>
		/// <param name='array'><para>The one-dimensional <see cref='System.Array'/> that is the destination of the values copied from <see cref='SoftwareEditorCollection'/> .</para></param>
		/// <param name='index'>The index in <paramref name='array'/> where copying begins.</param>
		/// <returns>
		/// <para>None.</para>
		/// </returns>
		/// <exception cref='System.ArgumentException'><para><paramref name='array'/> is multidimensional.</para> <para>-or-</para> <para>The number of elements in the <see cref='SoftwareEditorCollection'/> is greater than the available space between <paramref name='index'/> and the end of <paramref name='array'/>.</para></exception>
		/// <exception cref='System.ArgumentNullException'><paramref name='array'/> is <see langword='null'/>. </exception>
		/// <exception cref='System.ArgumentOutOfRangeException'><paramref name='index'/> is less than <paramref name='array'/>'s lowbound. </exception>
		/// <seealso cref='System.Array'/>
		public void CopyTo( SoftwareEditor[] array, int index)
		{
			List.CopyTo(array, index);
		}
		
		/// <summary>
		/// <para>Returns the index of a <see cref='SoftwareEditor'/> in 
		/// the <see cref='SoftwareEditorCollection'/> .</para>
		/// </summary>
		/// <param name='val'>The <see cref='SoftwareEditor'/> to locate.</param>
		/// <returns>
		/// <para>The index of the <see cref='SoftwareEditor'/> of <paramref name='val'/> in the 
		/// <see cref='SoftwareEditorCollection'/>, if found; otherwise, -1.</para>
		/// </returns>
		/// <seealso cref='SoftwareEditorCollection.Contains'/>
		public int IndexOf( SoftwareEditor val)
		{
			return List.IndexOf(val);
		}
		
		/// <summary>
		/// <para>Inserts a <see cref='SoftwareEditor'/> into the <see cref='SoftwareEditorCollection'/> at the specified index.</para>
		/// </summary>
		/// <param name='index'>The zero-based index where <paramref name='val'/> should be inserted.</param>
		/// <param name='val'>The <see cref='SoftwareEditor'/> to insert.</param>
		/// <returns><para>None.</para></returns>
		/// <seealso cref='SoftwareEditorCollection.Add'/>
		public void Insert(int index,  SoftwareEditor val)
		{
			List.Insert(index, val);
		}
		
		/// <summary>
		/// <para>Returns an enumerator that can iterate through 
		/// the <see cref='SoftwareEditorCollection'/> .</para>
		/// </summary>
		/// <returns><para>None.</para></returns>
		/// <seealso cref='System.Collections.IEnumerator'/>
		public new  SoftwareEditorEnumerator GetEnumerator()
		{
			return new  SoftwareEditorEnumerator(this);
		}
		
		/// <summary>
		/// <para> Removes a specific <see cref='SoftwareEditor'/> from the 
		/// <see cref='SoftwareEditorCollection'/> .</para>
		/// </summary>
		/// <param name='val'>The <see cref='SoftwareEditor'/> to remove from the <see cref='SoftwareEditorCollection'/> .</param>
		/// <returns><para>None.</para></returns>
		/// <exception cref='System.ArgumentException'><paramref name='val'/> is not found in the Collection. </exception>
		public void Remove( SoftwareEditor val)
		{
			List.Remove(val);
		}
		
		public class  SoftwareEditorEnumerator : IEnumerator
		{
			IEnumerator baseEnumerator;
			IEnumerable temp;
			
			public  SoftwareEditorEnumerator( SoftwareEditorCollection mappings)
			{
				this.temp = mappings;
				this.baseEnumerator = temp.GetEnumerator();
			}
			
			public  SoftwareEditor Current 
			{
				get 
				{
					return (( SoftwareEditor)(baseEnumerator.Current));
				}
			}
			
			object IEnumerator.Current 
			{
				get 
				{
					return baseEnumerator.Current;
				}
			}
			
			public bool MoveNext()
			{
				return baseEnumerator.MoveNext();
			}
			
			bool IEnumerator.MoveNext()
			{
				return baseEnumerator.MoveNext();
			}
			
			public void Reset()
			{
				baseEnumerator.Reset();
			}
			
			void IEnumerator.Reset()
			{
				baseEnumerator.Reset();
			}
		}
	}

	
	[Serializable]
	public class SoftwareEditor : Company, IPersistable, ISoftwareEditor 
	{		
	
		void IPersistable.TrackChildren()
		{
			// if the object is not tracked there is nothing to do
			if(_PersistenceManager == null)
				return;
	
		}
		
		void IPersistable.DeleteChildren()
		{	
	
		}
	
		public System.String SoftwareSort
		{
			get 
			{ 
				if(_Entity.GetValue("SoftwareSort") == null)
					return (new System.String[1])[0];
				else
					return (System.String)this._Entity["SoftwareSort"]; 
			}
		
			set 
			{ 
				this._Entity["SoftwareSort"] = value; 
			}
		}
		
		public SoftwareEditor ()
		{
			
			this._Entity = new Entity(PersistenceManager.ConvertNamespaceDomainToEuss(this.GetType().FullName));
		}

		public SoftwareEditor (Entity e): this()
		{
			this._Entity = e;
		}

		private ParentRelationships _Parents;

		public new ParentRelationships Parents
		{
			get
			{
				if (_Parents == null)
					if (_PersistenceManager == null)
						throw new ApplicationException("Can't call Parents untracked objects");
				else
					_Parents = new ParentRelationships(this);

				return _Parents;
			}
		}

		public new class ParentRelationships
		{
			private IPersistable _Owner;
	
			public ParentRelationships(IPersistable o)
			{
				_Owner = o;
			}
		
		}
	}

}
